Camera Path Editor
For Terragen

Disclaimer & Legal

The Program (CAMPATH.EXE) is provided as-is. The Author (Sean O'Malley) is not liable in any way for any damages incurred, software or hardware, including loss of data, through the use of the Program or files it produces. Do not redistribute the Program in any medium or sell it without permission from the Author. Do not modify the Program or its documentation in any way. Give the Author notification and appropriate credit if using animations created by this for commercial purposes or public display (motion pictures, television, etc). By executing CAMPATH.EXE you agree to these terms.

The Camera Path Editor (CamPath) is copyright ©1999 by Sean O'Malley.
The program Terragen is copyright ©1999 by M.P. Fairclough.


Now that that's over with...
System Requirements

This program is written on Windows '98, but it should run just as well on Windows '95 and NT. It is advisable to use the latest version of Terragen with CamPath since support for some scripting functions used by CamPath may have been only recently added to Terragen.

I highly recommended using a monitor set to 24-bit True Color or higher. If CamPath displays "OpenGL Disabled" beneath the logo on the main menu, OpenGL was not detected and needs to be properly installed before the OpenGL features will be enabled.

IMPORTANT: You need a file called MSVBVM50.DLL to use CamPath. If you don't have this file on your computer, you'll need to download it and copy it to your Windows/System directory before CAMPATH.EXE will work. This freely available file can be downloaded from these sites, among many other places on the Internet: For OpenGL-related files, visit http://www.opengl.org/.

Or, visit the CamPath webpage for links to necessary resources. (See Contacting the Author below.)
Installation

To install the Camera Path Editor:

  1. Using WinZip or a similar utility, unzip the contents of the CamPath archive (CPE???.ZIP) to a new folder named CamPath. You should now have a new folder containing CAMPATH.EXE along with this documentation and one or two other files.
  2. There are different ways CamPath can be accessed:
    1. CamPath can be run directly from its folder by double-clicking on CAMPATH.EXE.
    2. A shortcut to CAMPATH.EXE can be created somewhere else - on the desktop or in the Windows Start menu for example. Then it can be run without going into its folder.
    3. CamPath can be run directly from Terragen by moving the new CamPath folder into the folder where Terragen is installed. As long as CamPath is located in a folder named CamPath inside the folder where Terragen resides, it can be accessed from the Terragen menus. If CamPath is moved to the incorrect location, Terragen will give an error when it tries to run CAMPATH.EXE.

What It Is

The Camera Path Editor ("CamPath") is a program which produces script files to generate animations using the photorealistic terrain rendering program Terragen. Using advanced curve-generating techniques, the camera can be moved and oriented in 3-D space in almost any way, including moving directly over the terrain like a vehicle and through the air like an airplane. CamPath is currently under development and should be considered a "beta" version; there are probably a few bugs and I make no guarantees as to its stability or the safety of the computer it's running on. Currently, the program supports these features: I hope to add more features in future versions. See the Contacting section for a link to my web page, where any future versions will be made available.
A Short Tutorial

If you've never used a program similar to this, this will provide a step-by-step guide to creating your first animation. This assumes you've used Terragen before and are familiar with its functions.
    Making a simple airplane-like animation.
  1. When you first start CAMPATH.EXE, you'll be shown the main screen. There will be no visible terrain map and the status bar will read "No Terrain Loaded."
  2. The first thing to do is load a terrain file. Terrain files are the same "TER" or "TERRAIN" files that Terragen reads. CamPath won't let you create a path without loading a terrain file since it needs the height data to create points. If you have a terrain file saved on your computer already, continue: Go to File-->Open Terrain File. Navigate through the directories and double-click on the terrain file.
  3. CamPath will read in the file and draw it onscreen in a window that opens up. It will move the main screen over a bit to make room.
  4. If you plan on having water in your scene, click the Water Level button on the main screen and set the water level. If you change it, the map will redraw showing submerged areas in blue on the map. It's good to set the water level first since CamPath will show you if your path falls beneath the water (or land) level. (To find a good starting setting for the water level, click Miscellaneous->Terrain Statistics. The "weighted average" is a good value to place the water level initially.)
  5. Now to define a camera path. Notice the box in the left side of the main screen which says "Clicking on Map." Make sure this is set to "Adds a New Path Point." This means that if you click on the terrain map area, it will add new points to your path. If "Changes Location/Selects Point" is selected, you can move previously created points around or select points with the left and right mouse buttons.
  6. Click on the map to create points which you want the camera to pass through. The first point will be the starting point, and creating further points will lengthen the path. If you want to delete a point, right-click on it and press the "Delete Point" button or hit delete on your keyboard. Notice the box in the lower-left corner of the screen will change to "Changes Location/Selects Point" since you're now in point selection mode. You can change it back to "Adds a New Path Point" if you want to continue adding points.
  7. If any part of your camera path falls below ground (or water) level, it will turn red instead of white. Right-click on any point and then change its Absolute Height in the appropriate box to raise it as necessary. By default, each point you create will be 5 units above the surface of the terrain, but the path may still fall below ground level between points.
  8. Select any point (right-click on the map near the point you want to select) to change its parameters. For instance, right-click on a point and change its speed in the boxes on the right simply by typing a new speed value in when a point is selected.
  9. You now have a complete airplane-like animation. If you want CamPath to control the banking angle of your "airplane," click the "Use Auto-Banking" button. You can also control the banking manually by changing the banking value for each point (just like changing the speed value for each point), but this won't be as realistic and you pretty much have to guess on the angles.
  10. Click the "Preview Movie" button to see how your animation will go. Press Play when the animation menu appears. When finished viewing, click "Halt & Close". You will be told how many frames your animation contains. If there are too many frames (or too few), type Ctrl-M to go to the Global Change menu. This will allow you to change the speed value for all your path points at once. Increasing the speed (entering a percentage higher than 100) will shorten your animation, while decreasing will lengthen it.
  11. Go to the file menu and click "Save Terragen Script" or press Ctrl-S. This will let you select the filename and directory for the script. After you choose how you want to save it, it will ask for the base filename for the frames Terragen will produce. See the Save Terragen Script section in the How to Use It section below for more information on this. When you're done, it will give you a message saying the script was saved. Now go into Terragen, load up the terrain file, set the clouds, image resolution, lighting settings, and everything else. When you're finished, go to the Terragen-->Execute Script... menu and select the script file saved by the Camera Path Editor. A render window should pop up and it'll render all your frames!
  12. When it's finished, you'll have a bunch of BMP files that can be compiled into a movie.

How to Use It

This section is divided into different parts for each section of the program.

The Main Screen
The main screen has several major sections:
  1. The menu bar contains different options and windows which are explained in more detail after this section.
  2. Points to View & Modify This section lets you choose what kind of paths you want and which you're currently editing. If you want a LookAt path, click the checkbox in the upper-right of this section; LookAt Path will become un-greyed. Choose the options on the left to select which points you're currently modifying. Check "Use Auto-Banking" to turn that feature on (auto-banking only works when a LookAt path is not specified).
  3. Misc Miscellaneous controls: A button that shows the current water level and can be used to set the current water level; whether or not to use a Lookat path; and whether or not to use Auto-Banking. (Look under "The View Menu" below for more information on setting the water level.)
  4. Clicking on Map: Lets you choose what happens when you click on the map. Right-clicking will always select the nearest point to where you click, but this box lets you choose whether you want to add a new path point or move around the points currently on the map.
  5. The map window that appears shows the terrain you'll be placing a path over. Clicking on this map has different effects according to what the Clicking on Map section on the main screen is set to. Also, if you click on the map to select a point, you can press delete (on your keyboard) or the "Delete Point" button to remove that particular point. When a point is selected, using the arrow keys while the map has "focus" will move the selected point around on the map (for fine-tuning). Holding down Shift while pressing the arrow keys will make it move the point faster.
  6. Legend This tells what the different colored points mean and also what it means when your path turns red in certain places. (It means your path is going underground and you'll want to raise the elevation on one or both of the points which that section of path is connected to. But while it does matter if your camera path goes underground, it doesn't really matter if your lookat path does!)
  7. Control Points This tells how many points are currently in use for either the Camera path or LookAt path. You can also select a point by clicking on the list instead of right-clicking on the map.
  8. Point Data This is how you change the height, banking angle (if applicable), speed (if applicable), and camera zoom value (if applicable) for the currently selected point. You can also change the X,Y location of each point here, but it's easier to use the map to do that. Keep in mind that the map doesn't update automatically as numbers are entered in here, but only after the box you're typing in "loses focus" (for example, when you press tab to move to another section or click away from the box; in other words, when the cursor is no longer in the box the map will update). Note that the camera zoom value defaults to Terragen's default of 1.414.
  9. Insert Point... Inserts a point between two previously-made points. CamPath will ask which point you want to insert the new point after and it will place it exactly between the point you specify and the point that comes after it. (The new point will have the average values for everything - zoom, speed, height, etc - of the points it comes between.)
  10. Delete Point Delete the currently selected point.
In addition, there is a small status bar in the upper-right corner which will display various messages. Also, there is a button that says "Preview Movie." Pressing this will bring up the Animation Control Menu, which has the following features:
  1. Click the "Play" button (a right-arrow ">") to start playing.
  2. Click the "Pause" button (double-bars "| |") while playing to pause it.
  3. A looping animation will automatically loop when it reaches the end. A non-looping animation will stop when it reaches the end, but you can press "Play" to start it again.
  4. Press "Close & Halt" any time to close the animation control window and return to normal operation.
  5. While the animation is paused, you can move the position bar back and forth to move the animation backwards and forwards in time.
The File Menu
  1. New Path Erases all your current path points and lookat points, resets the cloud and sun movement menus, resets the water level, redraws the map, and a few other things. This doesn't reset anything on the General Options menu.
  2. Open Terrain File This allows you to open a terrain file. Note that Campath won't let you create a path until a file is opened. After you select a file and it's finished drawing the map, you can start defining a path.
  3. Open Camera Path File Open a previously saved Camera Path File (CPF). This file is generated only by the Save Camera Path File option and is in a format specific to CamPath.
  4. Save Terragen Script When you're through specifying path points and everything else, this allows you to create a script file. When you're finished selecting an output filename and the directory to stick it in, it will bring up another menu which will ask where to put all the BMP files Terragen will produce for the animation. You can select the path and the basic filename for the BMP files to be produced. For example, if you want to create ANIM0001.BMP, ANIM0002.BMP, etc, you should enter ANIM (don't forget to select a directory path for where to save the BMPs as well).
  5. Save Camera Path File Save a Camera Path File (CPF) to be loaded later on. CPFs contain everything about your animation (camera points, lookat points, sun movement, cloud movement, water level, etc) so your animation can always be exactly reproduced by loading the correct terrain file with the correct CPF. But, a CPF does not save anything from the Options menu, nor does it remember what terrain file the CPF goes with. CPF files can only be used by the Camera Path Editor. If you saved a CPF file with a previous version of CamPath and try to load it with a later version, you will receive a warning asking if you want to attempt to load the old file. Do so at your own risk!
  6. Save POV Scene Generate a POV-Ray scene file and a 16-bit TGA image based on the current terrain. Requires at least one camera point and one lookat point in order to compute the scene.
  7. Make Movie Sequence Similarly to Terragen, this allows you to generate a sequence of BMP images from the animation that can be later compiled into a movie. It runs the OpenGL preview, saving each frame to disk. OpenGL Only
  8. Exit Self-explanatory!
The View Menu
  1. 2x Map View Magnifies the terrain map to twice its normal area so it's easier to lay paths on detailed terrain. Note that it takes longer for the terrain and the paths to draw when the terrain is magnified.
  2. 50% Map View De-magnifies the terrain so larger maps can be worked on. With this checked, terrains of up to 600x800 resolution and above can be edited easily. (But CamPath can theoretically load terrains of any resolution until it runs out of memory and dies.) CamPath automatically checks this option if it's loading an "oversized" terrain.
  3. Coordinate Windows Moves and resizes the main window, the height graph window (if it's open), and the terrain window so they're more organized.
  4. Overlay Paths If you use a camera path and lookat path simultaneously, this will allow you to see both paths on the map at the same time (so you can see where they are in relation to each other). When this option is checked, the path you are working on will be shown normally and the path you are not working on will be drawn underneath in a solid color using a dotted line. Click this option to turn it on and off.
  5. Height Graph Opens the height graph window. This window shows a graph of the current path (either lookat or camera) in relation to the terrain it goes over. Points can be selected on the height graph by clicking on them. Points can be moved when selected using the up-and-down arrow keys (make sure the graph has "focus" or else it won't register your keypresses). Hold down Shift while pressing the arrow keys to make it move faster. The graph window can be set to be always be on top and is also fully resizable so you can shrink it to a small box or enlarge it to see more detail.
  6. Water Level This lets you set the water level for the current map. Note that this does not tell Terragen what the water level should be (currently, there is no script command to do this). What this does is let you (1) see what the terrain would look like with certain water levels, and (2) make sure your camera path doesn't go "underwater" if the water were at this level. In other words, if you want water in your animation, the best thing to do is to set both CamPath and Terragen to the same water level value. The path line will turn red if it goes underwater (the same as if it were going underground). If you change the water level from its default of -1000, CamPath will also put a comment into the script it produces telling what water level the script was created for. The water level may be a decimal value.
  7. Visualization Options Contains two sections:
    • Overhead Map Options Control how objects are drawn on the overhead map. Most of these options control the appearance of the camera during the animation preview, but this menu also allows changing the width of the path lines on the overhead map.
    • 3-D View Options Control the appearance of the OpenGL window and the detail of the terrain. Allows you to make the 3-D preview window larger or smaller and to change the aspect ratio (this doesn't normally need to be changed). After changing the resolution of the terrain model, click the "Rebuild Terrain Model" button. (This is only required after moving the "Resolution of 3-D terrain model" slider.) OpenGL Only
  8. 3-D Relief Map This selection lets you turn the 3-D map display on or off. Off, the overhead map will display the normal heightfield without any 3-D enhancement. This is usually best when working on detailed animations since the terrain height at any given point is directly related to the brightness of the map at that point. With the 3-D effect on, you'll get a more "realistic" 3-D view of the terrain. This greatly enhances the detail of the map, but makes the actual elevations at individual points less apparent.
  9. 3-D Lighting Control Brings up a menu where various aspects of the lighting of the 3-D Relief Map can be modified.
The Animation Menu
This menu controls various aspects of the final rendered animation.
  1. Cloud Movement This menu is rather self-explanatory. A checkmark will appear next to this menu item if cloud movement is activated.
  2. Sun Movement Lets you control the sun similarly to the clouds, only you control exactly where it starts and ends. (Sort of like using the scripter that comes with Terragen.) A checkmark will appear next to this menu item if sun movement is activated. A few items to note:
    • The Opposite Heading Movement switch: This doesn't mean the heading of the sun will go backwards from the end value to the start value (you can simply replace the values for each to do that!). What this does is sets which way around the circle you want the sun to go to get from angle A to angle B. Obviously, there are two ways of doing it; if you find it's not going the right way, just check this option. I made this option because I noticed that sometimes it's difficult to get the Terragen scripter to go in the right direction with sun values, but this makes it easy to go either way. This doesn't affect the altitude since it won't experience this problem.
    • The speed of the sun preview animation has nothing to do with the speed of the regular camera animation. I've set it to play 50 "frames" of animation for approximately 5 seconds no matter how far the heading or altitude go. The preview will last the same length of time no matter what, but the movement of the sun in the final animation script will cover the entire animation from start to finish.
  3. Vehicle Cam An experimental vehicle simulator that allows you to drive directly over the terrain (or water) staying a constant height above ground, even when going from water to land or vice-versa. As this is still "under development," the only available help for this feature is on the Vehicle Cam menu itself. Note:
    • It is not possible to use a Lookat path with the Vehicle Cam, so any lookat path you create will be automatically erased when you create a script or view the preview.
    • Turning the Vehicle Cam on doesn't affect the height values for the camera points themselves; it merely overrides them during script creation, on the height graph, and during the preview animation.
    • A checkmark will appear next to this menu item if the Vehicle Cam is enabled.
The Miscellaneous Menu
  1. General Options Brings up a menu where you can change:
    • The default speed for each newly created point.
    • The default height above terrain for each newly created point.
    • What to maintain when points are moved on the map. (When you click on the map to move a point, does it keeps its old absolute height or set a new absolute height based on its height above terrain?)
    • The path resolution controls how detailed the paths will be on the height graph and on the overhead map. It also controls the amount of detail of the terrain on the height graph (good to make sure your path doesn't hit anything on rough terrains). However, the paths will take longer to draw the higher the path resolution is set.
    • The number of frames per second for the preview animation. This does not determine how many frames your final animation will have, just how quickly they will go by in the preview. If your computer can't handle the number of FPS you specify here, it will do its best. Also, at the end of the preview animation or after saving your script, CamPath will compute the total length in seconds of your animation based on the number of frames it contains and the FPS value you specify here.
    • Auto-bank exaggeration factor. This normally doesn't need to be changed unless you want the camera either to bank more or less when auto-banking is turned on; the default value will work well for most animations. This can be changed either to make the camera move more flatly or (if a negative number is specified) bank in the opposite direction it normally would. A fuller explanation of this is given on the menu itself.
    • Default directories for opening and saving files.
    There are also two buttons on this menu:
    • Save Current Values as Default When you click this button, whatever the options are currently set to is saved to a configuration file. Then, whenever CamPath is run, it will use these values; this makes it unnecessary to reset the general options each time CamPath is run. You should also make sure to save the configuration if you want it to remember the default file opening and saving directories.
    • Restore "Factory" Presets This erases the configuration file and resets all options to what they were in the beginning. These are also the settings that are used if no configuration file exists or if you erase it manually.
  2. Global Change Menu This contains a number of functions that allow you to make various changes to the whole animation at once. (Changing the length of the animation, reversing paths, copying paths, etc.)
  3. Compute Number of Frames Tells you how many frames are in your animation currently.
  4. FOV Calculator Converts between different field-of-view measurement units to Terragen's zoom values.
  5. Terrain Statistics Tells information about the terrain:
    • Maximum height - The highest point on the terrain.
    • Minimum height - The lowest point on the terrain.
    • Height range - The maximum height minus the minimum height.
    • Average height - Half-way between the maximum and minimum heights.
    • Weighted average - This value is an average of all the height values of all the points put together; it isn't a simple (unweighted) average of the maximum and minimum heights. This value is usually a good initial setting for the water level.
    • (TG) Base height - The "base height" value read from the terrain file.
    • (TG) Height scale - The "height scale" value read from the terrain file.
The Help Menu
This has an "About" screen that tells you a few things including the current version of the program you're using, and a message telling you to read this file if you need help!
Known Bugs


Notes & Tips on Usage


About OpenGL

OpenGL is a 3-D graphics library that has become a standard for 3-D graphics. CamPath utilizes this library to generate 3-D previews of animations so that it's not necessary to wait for a final render in Terragen to get an idea of what the animation will look like.

CamPath will automatically detect whether the OpenGL library is available on your system. If not, it will run perfectly without the OpenGL enhancements. If it detects OpenGL, it will display "OpenGL Enabled" beneath the logo on the main menu; otherwise, it will display "OpenGL Disabled" in the same place.

To find out more about OpenGL and to download the necessary files to use it, visit http://www.opengl.org/.

Contacting the Author

The author, Sean O'Malley, can be reached at:
E-mail: ffrog@geocities.com
Web page: http://www.geocities.com/~ffrog

I welcome any and all e-mail: Bug reports, compliments, messages of eternal gratitude, offers of money, threats, etc. (No SPAM!)

I have a web page dedicated to this program. Its URL is: http://www.geocities.com/~ffrog/campath.html
It contains links to galleries containing animations created with CamPath, the latest version, screenshots, sample movies, links to resources and more.
Of course, Matt Fairclough's excellent and amazing terrain rendering program Terragen can be downloaded from his web page at http://www.planetside.co.uk/

- Sean O'Malley
Credits...

A special thanks to the following bunch of people, who helped either directly or indirectly: ---Sean O'Malley
...September, 1999
...UH